package com.fixme4trade.persistence;

import javax.inject.Inject;
import javax.management.Query;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;
import org.slf4j.Logger;
import com.fixme4trade.constant.Role;
import com.fixme4trade.domain.Product;
import com.fixme4trade.domain.Seller;
import com.fixme4trade.domain.User;
import br.gov.frameworkdemoiselle.stereotype.PersistenceController;
import br.gov.frameworkdemoiselle.template.JPACrud;
import br.gov.frameworkdemoiselle.transaction.Transactional;

@PersistenceController
public class SellerDAO extends JPACrud<Seller, Long> {
	
	private static final long serialVersionUID = 1L;

	@Inject
	@SuppressWarnings("unused")
	private Logger logger;
	
	@Inject
	private EntityManager em;
	
	@Inject
	private UserDAO userDAO;
	
	/*
	@Transactional
	public void activateSellerAccount(User user) {
		Seller seller = new Seller();
		seller.setUser(user);
		
		user.getRoleList().add(Role.SELLER);
		
		userDAO.update(user);						
		this.insert(seller);
	}
	*/		
}
